package com.bobo.web.provider.util.commutils;

import org.springframework.cglib.beans.BeanCopier;
import org.springframework.cglib.core.Converter;

/**
 * Created by wei.song on 2017/6/29.
 */
public class BeanUtils {

    public static void copyProperties(Object dest, Object orig) {
        BeanCopier.create(orig.getClass(), dest.getClass(), false).copy(orig, dest, null);
    }

    public static void copyProperties(Object dest, Object orig, Converter converter) {
        BeanCopier.create(orig.getClass(), dest.getClass(), true).copy(orig, dest, converter);
    }

}
